package com.group8.ge;

import javax.swing.ImageIcon;

import com.group8.gm.GameController;

public class Noodle extends GameObject{
	
	double speed;
	double hop_dist;
	int gun;
	GameController gc;
	public Noodle(GameController gc){
		gun = 1;
		this.gc = gc;
		img = new ImageIcon("assets/noodle.png").getImage();
		setHeight(100);
		setWidth(44);
	}
	
	public void applyBonus(Bonus b){
		if(b.getType() == 0){
			gun++;
		}
		else if(b.getType() == 1){
			hop_dist += ((HoppingBonus)b).getHopAmount();
		}
		else if(b.getType() == 2){
			
		}
		else{
			gc.incrementScore(((PointBonus)b).getPAmount());
		}
	}
	
	public void moveHorizontal(int amount) {
		
		setX(getX()+amount);
		if(getX() < -22)
			setX(638);
		else if(getX() > 780)
			setX(22);
		gc.updateUI();
	}
	
	public void hop() {
		
		
		
	}
	public void fire(){
		
	}
	/**
	 * @return the x
	 */
	public double getX() {
		return x;
	}
	/**
	 * @param x the x to set
	 */
	public void setX(double x) {
		this.x = x;
	}
	/**
	 * @return the y
	 */
	public double getY() {
		return y;
	}
	/**
	 * @param y the y to set
	 */
	public void setY(double y) {
		this.y = y;
	}
	/**
	 * @return the speed
	 */
	public double getSpeed() {
		return speed;
	}
	/**
	 * @param speed the speed to set
	 */
	public void setSpeed(double speed) {
		this.speed = speed;
	}
	/**
	 * @return the hop_dist
	 */
	public double getHop_dist() {
		return hop_dist;
	}
	/**
	 * @param hop_dist the hop_dist to set
	 */
	public void setHop_dist(double hop_dist) {
		this.hop_dist = hop_dist;
	}
	
	

}
